foo = 'foo';
foo = {};
foo.bar = 'foo.bar';
foo['bar'] = {};
foo['bar'].baz = 'foo[bar].baz';
foo['bar']['baz'] = {};
foo.bar['baz'].boom = 'foo.bar[baz].boom';
foo.bar['baz']['boom'] = {};
foo.bar['baz']['boom'].bam = 'foo.bar[baz][boom].bam';
foo.bar.baz.boom.bam.invalid = 'property assignment on string';